Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODStorageSystem


CreateContainer

Document Shell

The CreateContainer method creates a container object with the specified container type and identifier.

ODContainer CreateContainer (
                        in ODContainerType containerType, 
                        in ODContainerID id);
containerType
The type of the container object.
id
A container ID whose buffer contains data identifying the container object.
return value
A reference to the newly created container object.
DISCUSSION
The container type must be one of the following: the default file container for this platform (kODDefaultFileContainer), the default memory container for this platform (kODDefaultMemoryContainer), the Bento file container (kODBentoFileContainer), or the Bento memory container (kODBentoMemoryContainer).

The structure of the data in the id parameter's buffer depends on the type of container, as specified by the containerType parameter. For example, the identifier for a file container is a specification for a file-system file; the identifier for a memory container is a handle for a relocatable memory block.

The physical container corresponding to the specified container type and container identifier must exist when this method is called.

When the structure passed as the id parameter is no longer needed, the caller should deallocate that structure and its buffer.

This method initializes the reference count of the returned container. When the caller has finished using that container, it should call the container's Release method.

EXCEPTIONS
kODErrCannotCreateContainer
The specified container type is not valid.
kODErrContainerExists
A container already exists with the specified container type and container identifier.
SEE ALSO
The ODContainerID type (page 900).
The ODContainerType type (page 901).
The ODStorageSystem::AcquireContainer method (page 658).
The ODContainer class (page 98).
"Creating a New Document" on page 291 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help